<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">


    <h:head>
        <title>  <ui:insert name="title"></ui:insert> </title>
        <h:outputStylesheet library="css" name="piaStyles.css"  />
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    </h:head>
    <f:view contentType="text/html">

        <h:body>                
            <div id="header" >
                <ui:insert name="header">
                    <p:layoutUnit position="north">
                        <p:outputLabel value="Elektrotehnicki fakultet" style="font-weight:bold; font-size: 32px"/>

                    </p:layoutUnit>
                </ui:insert>
            </div>

            <div id="sidebar" >

                <ui:insert name="sidebar">
                    <h:form>
                        <p:tieredMenu >
                            <p:menuitem value="Pocetna" outcome="pocetna"  />
                            <p:menuitem value="Moji predmeti" outcome="mojiPredmeti" rendered="#{userBean.isStudent}"/>
                            <p:menuitem value="Zaposleni" outcome="zaposleni" />
                            <p:menuitem value="Obavestenja" outcome="obavestenja" />
                            <p:submenu label="Osnovne studije"  >
                                <p:menuitem value="Katedra za RTI"  action="#{tableKatedre.loadRti}" />
                                <p:menuitem value="Softversko inzinjerstvo" action="#{tableKatedre.loadSi}" />
                                
                            </p:submenu>

                            <p:menuitem value="Master studije" action="#{tableKatedre.loadMaster()}" />
                            <p:menuitem value="Doktorske studije" action="#{tableKatedre.loadDoktorske()}" />
                            <p:menuitem value="Projekti" outcome="projekti" />
                            <p:submenu label="Nauka">
                                <p:menuitem value="Istrazivanja" outcome="istrazivanja" />
                                <p:menuitem value="Projekti" outcome="pocetna" />
                                <p:menuitem value="Publikacije" outcome="publikacije" />                            
                            </p:submenu>  
                            <p:submenu label="Servisi" transient="true">
                                <p:menuitem value="Fakultet" url="http://www.etf.rs" />
                                <p:menuitem value="Studentski servisi" url="http://student.etf.rs" />
                                <p:menuitem value="Mejling lista" url="http://lists.etf.rs" />
                                <p:menuitem value="Paviljon-laboratorije" url="http://rti.etf.rs/sale" />
                            </p:submenu> 
                            <p:menuitem value="Kontakt" outcome="kontakt" />

                        </p:tieredMenu>

                        <p:tieredMenu rendered="#{userBean.isNastavnik}">
                            <p:menuitem value="Profil" outcome="profilZaposleni"  />
                            <p:menuitem value="Predmeti" outcome="predmetiZaposleni" />
                            <p:menuitem value="Obavestenja o predmetima" outcome="obavestenjaZaposleni" />
                            <p:menuitem value="Spiskovi" outcome="spiskoviZaposleni" />

                        </p:tieredMenu>

                        <p:tieredMenu rendered="#{userBean.isAdmin}">                     
                            <p:menuitem value="Plan angazovanja"  outcome="planAngazovanja" />
                            <p:submenu label="Dodaj"  >
                                <p:menuitem value="Predmet"  outcome="dodajPredmet" />
                                <p:menuitem value="Zaposleni" outcome="dodajZaposlenog" />
                                <p:menuitem value="Student" outcome="dodajStudenta" />
                                								
                            </p:submenu>
                            <p:submenu label="Azuriraj"  >
                                <p:menuitem value="Predmet"  outcome="azurirajPredmet" />
                                <p:menuitem value="Zaposleni" outcome="azurirajZaposlenog" />
                                <p:menuitem value="Student" outcome="azurirajStudenta" />																
                            </p:submenu>
                        </p:tieredMenu>

                    </h:form>

                    <h:form>
                        <p:growl id="errorMessage" showDetail="true" sticky="false"/>
                        <h:panelGrid id="login" columns="1" cellpadding="5" rendered="#{userBean.renderLogin}">
                            <h:outputText value="Korisnicko ime" style="color: #238AC2" />

                            <p:inputText id="Username" value="#{userBean.ime}" required="true"  requiredMessage="Morate uneti korisnicko ime."/>

                            <h:outputText value="Lozinka" style="color: #238AC2"/>

                            <p:password value="#{userBean.lozinka}" required="true" requiredMessage="Morate uneti lozinku" />

                            <h:commandButton action="#{userBean.attempLogin}" value="Uloguj se" />                      
                        </h:panelGrid>
                    </h:form>

                    <h:form >
                        <p:outputPanel id="logoutForm" style="margin-top: 10px" rendered="#{!userBean.renderLogin}">
                            <h:panelGrid columns="1" cellpadding="10">
                                <h:outputText value="Dobrodosli,"/>
                                <h:outputText value="#{userBean.getImePrezime()}"/>
                                <h:commandButton value="Odjavi se" action="#{userBean.attemptLogout()}" />
                                <p:button value="Promeni lozinku" outcome="promenaLozinke"/>
                            </h:panelGrid>
                        </p:outputPanel>
                    </h:form>
                </ui:insert>
            </div>       

            <div class="center"><ui:insert name="center">
                </ui:insert></div> 



           

        </h:body>

    </f:view>
</html>

